$().ready(function(){
    $.ajax({
        type:"get",
        datatype:"json",
        url:zonghenewsurl+190+"&userId="+id,//api/typeinfo/GetSecondTypeByParentId?parentId=
        success:function(data){
            console.log(data);
            for(var i=0;i<data.Data.length;i++){
                //<span class='tc_unread'>
                $("#listbox").append("<li class='Cell' id="+data.Data[i].id+"><div class='tc_image'><img src='hyimg/"+data.Data[i].id+".png' class='topic_photo_img'/></div><span class='tc_inner' id='zh"+data.Data[i].id+"'><span class='tc_text'>"+data.Data[i].typename+"</span></span></span><div class='tc_stroke'></div></li>")
            }
        }
    });
    $("#page_wrapper").delegate("li.Cell","click",function(e){
        var eventnode= e.target;
        var tpid=0;
        var nameword="";
        if(eventnode.className=="tc_text"){
            tpid=eventnode.parentNode.parentNode.id;
            nameword=eventnode.innerHTML;
            console.log("点击汉字对应的ID:"+tpid+"  对应的内容是："+nameword);
        }else if(eventnode.className=="tc_inner"){
            tpid=eventnode.parentNode.id;
            nameword=eventnode.firstChild.innerHTML;
            console.log("点击inner对应的ID:"+tpid+"  对应的内容是："+nameword);
        }
		//页面直接跳转
		location.href="mycountry.html?typeid="+tpid+"&nameword="+nameword+"&from=zonghe";
        //提交点击次数
        //$.ajax({
        //    //提交数据的类型 POST GET
        //    type: "post",
        //    //提交的网址
        //    url: "http://42.62.66.198:9001/api/PuluUserFavorType/AddTypeCount",
        //    //提交的数据
        //    data: { "userId":id ,"typeId":tpid},
        //    //返回数据的格式
        //    datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
        //    //成功返回之后调用的函数
        //    success: function (data) {
        //        //if($.cookie("newsid")){
                    $.cookie("currentIndex","");
                    $.cookie("scrollTop","");
                    $.cookie("newsid","");
                    $.cookie("totop","");
        //        //}
        //        location.href="mycountry.html?typeid="+tpid+"&nameword="+nameword;
        //    },
        //    error: function (XMLHttpRequest, textStatus, errorThrown) {
        //        alert("ajax失败！" + errorThrown);
        //    }
        //});
    })

});
